package com.liuyang.demo.redis;

import com.liuyang.demo.redis.cache.RedisUtil;
import io.lettuce.core.RedisClient;
import io.lettuce.core.api.StatefulRedisConnection;
import io.lettuce.core.api.sync.RedisStringCommands;

import java.util.Set;

public class BasicUsage {
    public static void main(String[] args) {
        RedisClient client = RedisClient.create("redis://192.168.217.14:6379");
        StatefulRedisConnection<String, String> connection = client.connect();
        RedisStringCommands sync = connection.sync();
        String value = String.valueOf(sync.get("foo"));
    }
    public static void t(){

        //RedisUtil redisUtil =new RedisUtil();
        //Set<Object> smembers = redisUtil.smembers("hmsd:user.punch:nutrition.sport:2021-03-12");
        //log.debug(smembers.toString());
        //String.valueOf(redisUtil.ttl("hmsd:user.punch:nutrition.sport:2021-03-12"))

    }
}
